             <!-- manual page source format generated by PolyglotMan v3.2, -->
<!-- available at http://polyglotman.sourceforge.net/ -->

<html>
<head>
<title>ZIPINFO(1) manual page</title>
</head>
<body bgcolor='white'>
<a href='#toc'>Table of Contents</a><p>

<h2><a name='sect0' href='#toc0'>Name</a></h2>
zipinfo - list detailed information about a ZIP archive
 
<h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
<b>zipinfo</b> [<b>-12smlvhMtTz</b>] <i>file</i>[<i>.zip</i>] [<i>file(s)</i>&nbsp;...] [<b>-x</b>&nbsp;<i>xfile(s)</i>&nbsp;...] <p>
<b>unzip</b> <b>-Z</b>
[<b>-12smlvhMtTz</b>] <i>file</i>[<i>.zip</i>] [<i>file(s)</i>&nbsp;...] [<b>-x</b>&nbsp;<i>xfile(s)</i>&nbsp;...]   
<h2><a name='sect2' href='#toc2'>Description</a></h2>
<i>zipinfo</i> lists
technical information about files in a ZIP archive, most commonly found
on MS-DOS systems.  Such information includes file access permissions, encryption
status, type of compression, version and operating system or file system
of compressing program, and the like.  The default behavior (with no options)
is to list single-line entries for each file in the archive, with header
and trailer lines providing summary information for the entire archive.
 The format is a cross between Unix &lsquo;&lsquo;ls -l&rsquo;&rsquo; and &lsquo;&lsquo;unzip -v&rsquo;&rsquo; output.  See <b>DETAILED
DESCRIPTION</b> below.  Note that <i>zipinfo</i> is the same program as <i>unzip</i> (under
Unix, a link to it); on some systems, however, <i>zipinfo</i> support may have
been omitted when <i>unzip</i> was compiled.   
<h2><a name='sect3' href='#toc3'>Arguments</a></h2>

<dl>

<dt><i>file</i>[<i>.zip</i>] </dt>
<dd>Path of the ZIP
archive(s).  If the file specification is a wildcard, each matching file
is processed in an order determined by the operating system (or file system).
 Only the filename can be a wildcard; the path itself cannot.  Wildcard
expressions are similar to Unix <a href='egrep.1'><i>egrep</i>(1)</a>
 (regular) expressions and may
contain: <blockquote></dd>

<dt>*</dt>
<dd>matches a sequence of 0 or more characters </dd>

<dt>?</dt>
<dd>matches exactly 1
character </dd>

<dt>[...]</dt>
<dd>matches any single character found inside the brackets; ranges
are specified by a beginning character, a hyphen, and an ending character.
 If an exclamation point or a caret (&lsquo;!&rsquo; or &lsquo;^&rsquo;) follows the left bracket, then
the range of characters within the brackets is complemented (that is, anything
<i>except</i> the characters inside the brackets is considered a match).  To specify
a verbatim left bracket, the three-character sequence &lsquo;&lsquo;[[]&rsquo;&rsquo; has to be used.
</dd>
</dl>
</blockquote>

<dl>

<dt>(Be sure to quote any character that might otherwise be interpreted or
</dt>
<dd>modified by the operating system, particularly under Unix and VMS.)  If
no matches are found, the specification is assumed to be a literal filename;
and if that also fails, the suffix .zip is appended.  Note that self-extracting
ZIP files are supported, as with any other ZIP archive; just specify the
.exe suffix (if any) explicitly. </dd>

<dt>[<i>file(s)</i>]</dt>
<dd>An optional list of archive members
to be processed, separated by spaces. (VMS versions compiled with VMSCLI
defined must delimit files with commas instead.) Regular expressions (wildcards)
may be used to match multiple members; see above.  Again, be sure to quote
expressions that would otherwise be expanded or modified by the operating
system. </dd>

<dt>[<b>-x</b>&nbsp;<i>xfile(s)</i>]</dt>
<dd>An optional list of archive members to be excluded from
processing.  </dd>
</dl>

<h2><a name='sect4' href='#toc4'>Options</a></h2>

<dl>

<dt><b>-1</b> </dt>
<dd>list filenames only, one per line.  This option excludes
all others; headers, trailers and zipfile comments are never printed.  It
is intended for use in Unix shell scripts. </dd>

<dt><b>-2</b> </dt>
<dd>list filenames only, one per
line, but allow headers (<b>-h</b>), trailers (<b>-t</b>) and zipfile comments (<b>-z</b>), as
well.  This option may be useful in cases where the stored filenames are
particularly long. </dd>

<dt><b>-s</b> </dt>
<dd>list zipfile info in short Unix &lsquo;&lsquo;ls -l&rsquo;&rsquo; format.  This is
the default behavior; see below. </dd>

<dt><b>-m</b> </dt>
<dd>list zipfile info in medium Unix &lsquo;&lsquo;ls -l&rsquo;&rsquo;
format.  Identical to the <b>-s</b> output, except that the compression factor,
expressed as a percentage, is also listed. </dd>

<dt><b>-l</b> </dt>
<dd>list zipfile info in long Unix
&lsquo;&lsquo;ls -l&rsquo;&rsquo; format.  As with <b>-m</b> except that the compressed size (in bytes) is printed
instead of the compression ratio. </dd>

<dt><b>-v</b> </dt>
<dd>list zipfile information in verbose,
multi-page format. </dd>

<dt><b>-h</b> </dt>
<dd>list header line.  The archive name, actual size (in
bytes) and total number of files is printed. </dd>

<dt><b>-M</b> </dt>
<dd>pipe all output through an
internal pager similar to the Unix <a href='more.1'><i>more</i>(1)</a>
 command.  At the end of a screenful
of output, <i>zipinfo</i> pauses with a &lsquo;&lsquo;--More--&rsquo;&rsquo; prompt; the next screenful may be
viewed by pressing the Enter (Return) key or the space bar.  <i>zipinfo</i> can
be terminated by pressing the &lsquo;&lsquo;q&rsquo;&rsquo; key and, on some systems, the Enter/Return
key.  Unlike Unix <a href='more.1'><i>more</i>(1)</a>
, there is no forward-searching or editing capability.
Also, <i>zipinfo</i> doesn&rsquo;t notice if long lines wrap at the edge of the screen,
effectively resulting in the printing of two or more lines and the likelihood
that some text will scroll off the top of the screen before being viewed.
 On some systems the number of available lines on the screen is not detected,
in which case <i>zipinfo</i> assumes the height is 24 lines. </dd>

<dt><b>-t</b> </dt>
<dd>list totals for
files listed or for all files.  The number of files listed, their uncompressed
and compressed total sizes , and their overall compression factor is printed;
or, if only the totals line is being printed, the values for the entire
archive are given.  The compressed total size does not include the 12 additional
header bytes of each encrypted entry. Note that the total compressed (data)
size will never match the actual zipfile size, since the latter includes
all of the internal zipfile headers in addition to the compressed data.
</dd>

<dt><b>-T</b> </dt>
<dd>print the file dates and times in a sortable decimal format (yymmdd.hhmmss).
The default date format is a more standard, human-readable version with
abbreviated month names (see examples below). </dd>

<dt><b>-U</b> </dt>
<dd>[UNICODE_SUPPORT only] modify
or disable UTF-8 handling. When UNICODE_SUPPORT is available, the option
<b>-U</b> forces <i>unzip</i> to escape all non-ASCII characters from UTF-8 coded filenames
as &lsquo;&lsquo;#Uxxxx&rsquo;&rsquo;. This option is mainly provided for debugging purpose when the
fairly new UTF-8 support is suspected to mangle up extracted filenames. </dd>

<dt>The
option <b>-UU</b> allows to entirely disable the recognition of UTF-8 </dt>
<dd>encoded filenames.
 The handling of filename codings within <i>unzip</i> falls back to the behaviour
of previous versions. </dd>

<dt><b>-z</b> </dt>
<dd>include the archive comment (if any) in the listing.
  </dd>
</dl>

<h2><a name='sect5' href='#toc5'>Detailed Description</a></h2>
<i>zipinfo</i> has a number of modes, and its behavior can
be rather difficult to fathom if one isn&rsquo;t familiar with Unix <a href='ls.1'><i>ls</i>(1)</a>
 (or
even if one is).  The default behavior is to list files in the following
format: <p>
<br>
<pre>
The last three fields are the modification date and time of
the file, and its name.  The case of the filename is respected; thus
files that come from MS-DOS PKZIP are always capitalized.  If the file
was zipped with a stored directory name, that is also displayed as part
of the filename.

The second and third fields indicate that the file was zipped under
Unix with version 1.9 of zip.  Since it comes from Unix, the file
permissions at the beginning of the line are printed in Unix format.
The uncompressed file-size (2802 in this example) is the fourth field.

The fifth field consists of two characters, either of which may take
on several values.  The first character may be either &lsquo;t&rsquo; or &lsquo;b&rsquo;, indicating
that zip believes the file to be text or binary, respectively;
but if the file is encrypted, zipinfo
notes this fact by capitalizing the character (&lsquo;T&rsquo; or &lsquo;B&rsquo;).  The second
character may also take on four values, depending on whether there is
an extended local header and/or an &lsquo;&lsquo;extra field&rsquo;&rsquo; associated with the
file (fully explained in PKWare&rsquo;s APPNOTE.TXT, but basically analogous to
pragmas in ANSI C--i.e., they provide a standard way to include non-standard
information in the archive).  If neither exists, the character
will be a hyphen (&lsquo;-&rsquo;); if there is an extended local header but no extra
field, &lsquo;l&rsquo;; if the reverse, &lsquo;x&rsquo;; and if both exist, &lsquo;X&rsquo;.  Thus the
file in this example is (probably) a text file, is not encrypted, and
has neither an extra field nor an extended local header associated with
it.
The example below, on the other hand, is an encrypted binary file with
an
extra field:



Extra fields are used for various purposes (see discussion of the -v
option below) including the storage of VMS file attributes, which is
presumably the case here.  Note that the file attributes are listed in
VMS format.  Some other possibilities for the host operating system (which
is actually a misnomer--host file system is more correct) include
OS/2 or NT with High Performance File System (HPFS), MS-DOS, OS/2 or NT
with File Allocation Table (FAT) file system, and Macintosh.  These are
denoted as follows:





File attributes in the first two cases are indicated in a Unix-like format,
where the seven subfields indicate whether the file:  (1) is a directory,
(2) is readable (always true), (3) is writable, (4) is executable (guessed
on the basis of the extension--.exe, .com, .bat, .cmd
and .btm files are assumed to be so), (5) has its archive bit set,
(6) is hidden, and (7) is a system file.  Interpretation of Macintosh file
attributes is unreliable because some Macintosh archivers don&rsquo;t store any
attributes in the archive.

Finally, the sixth field indicates
the compression method and possible sub-method used.  There are six methods
known at present:  storing (no compression), reducing, shrinking, imploding,
tokenizing (never publicly released), and deflating.  In addition, there
are
four levels of reducing (1 through 4); four types of imploding (4K or 8K
sliding dictionary, and 2 or 3 Shannon-Fano trees); and four levels of
deflating (superfast, fast, normal, maximum compression).  zipinfo
represents these methods and their sub-methods as follows:  stor;
re:1, re:2, etc.; shrk; i4:2, i8:3, etc.;
tokn; and defS, defF, defN, and defX.

The medium and long listings are almost identical to the short format except
that they add information on the file&rsquo;s compression.  The medium format lists
the file&rsquo;s compression factor as a percentage indicating the amount of space
that has been &lsquo;&lsquo;removed&rsquo;&rsquo;:



In this example, the file has been compressed by more than a factor of
five; the compressed data are only 19% of the original size.  The long
format gives the compressed file&rsquo;s size in bytes, instead:



In contrast to the unzip listings, the compressed size figures in
this listing format denote the complete size of compressed data, including
the 12 extra header bytes in case of encrypted entries.

Adding the -T option changes the file date and time to decimal
format:



Note that because of limitations in the MS-DOS format used to store file
times, the seconds field is always rounded to the nearest even second.
For Unix files this is expected to change in the next major releases of
zip(1) and unzip.

In addition to individual file information, a default zipfile listing
also includes header and trailer lines:









The header line gives the name of the archive, its total size, and the
total number of files; the trailer gives the number of files listed,
their total uncompressed size, and their total compressed size (not
including any of zip&rsquo;s internal overhead).  If, however, one or
more file(s) are provided, the header and trailer lines are
not listed.  This behavior is also similar to that of Unix&rsquo;s &lsquo;&lsquo;ls -l&rsquo;&rsquo;;
it may be overridden by specifying the -h and -t options
explicitly.
In such a case the listing format must also be specified explicitly,
since -h or -t (or both) in the absence of other options implies
that ONLY the header or trailer line (or both) is listed.  See the
EXAMPLES section below for a semi-intelligible translation of this
nonsense.

The verbose listing is mostly self-explanatory.  It also lists file
comments and the zipfile comment, if any, and the type and number of bytes
in any stored extra fields.  Currently known types of extra fields include
PKWARE&rsquo;s authentication (&lsquo;&lsquo;AV&rsquo;&rsquo;) info; OS/2 extended attributes; VMS
filesystem info, both PKWARE and Info-ZIP versions; Macintosh resource
forks; Acorn/Archimedes SparkFS info; and so on.  (Note
that in the case of OS/2 extended attributes--perhaps the most common
use of zipfile extra fields--the size of the stored EAs as reported by
zipinfo may not match the number given by OS/2&rsquo;s dir command:
OS/2 always reports the number of bytes required in 16-bit format, whereas
zipinfo always reports the 32-bit storage.)

Again, the compressed size figures of the individual entries include the
12 extra header bytes for encrypted entries.  In contrast, the archive total
compressed size and the average compression ratio shown in the summary
bottom line are calculated without the extra 12 header bytes of
encrypted entries.

Environment OptionsModifying zipinfo&rsquo;s default behavior via options placed
in an environment variable can be a bit complicated to explain, due to
zipinfo&rsquo;s attempts to handle various defaults in an intuitive, yet Unix-like,
manner.  (Try not to laugh.)  Nevertheless, there is some underlying logic.
 In brief, there are three &lsquo;&lsquo;priority levels&rsquo;&rsquo; of options:  the default options;
environment options, which can override or add to the defaults; and explicit
options given by the user, which can override or add to either of the above.
The default listing format, as noted above, corresponds roughly to the
"zipinfo -hst" command (except when individual zipfile members are specified).
A user who prefers the long-listing format (-l) can make use of the zipinfo&rsquo;s
environment variable to change this default: 
Unix Bourne shell: CWZIPINFO=-l;
export ZIPINFO Unix C shell: CWsetenv ZIPINFO -l OS/2 or MS-DOS: CWset ZIPINFO=-l
VMS (quotes for lowercase): CWdefine ZIPINFO_OPTS "-l" </pre>  </dd>
</dl>
<p>
If, in addition,
the user dislikes the trailer line, <i>zipinfo</i>&rsquo;s concept of &lsquo;&lsquo;negative options&rsquo;&rsquo;
may be used to override the default inclusion of the line.  This is accomplished
by preceding the undesired option with one or more minuses:  e.g., &lsquo;&lsquo;-l-t&rsquo;&rsquo; or
&lsquo;&lsquo;--tl&rsquo;&rsquo;, in this example.  The first hyphen is the regular switch character,
but the one before the &lsquo;t&rsquo; is a minus sign.  The dual use of hyphens may seem
a little awkward, but it&rsquo;s reasonably intuitive nonetheless:  simply ignore
the first hyphen and go from there.  It is also consistent with the behavior
of the Unix command <a href='nice.1'><i>nice</i>(1)</a>
. <p>
As suggested above, the default variable names
are ZIPINFO_OPTS for VMS (where the symbol used to install <i>zipinfo</i> as a
foreign command would otherwise be confused with the environment variable),
and ZIPINFO for all other operating systems.  For compatibility with <a href='zip.1'><i>zip</i>(1)</a>
,
ZIPINFOOPT is also accepted (don&rsquo;t ask).  If both ZIPINFO and ZIPINFOOPT
are defined, however, ZIPINFO takes precedence.  <i>unzip</i>&rsquo;s diagnostic option
(<b>-v</b> with no zipfile name) can be used to check the values of all four possible
<i>unzip</i> and <i>zipinfo</i> environment variables.   
<h2><a name='sect7' href='#toc7'>Examples</a></h2>
To get a basic, short-format
listing of the complete contents of a ZIP archive <i>storage.zip</i>, with both
header and totals lines, use only the archive name as an argument to zipinfo:
<p>
 <br>
<pre>zipinfo storage
</pre>  <p>
To produce a basic, long-format listing (not verbose), including header
and totals lines, use <b>-l</b>: <p>
 <br>
<pre>zipinfo -l storage
</pre>  <p>
To list the complete contents of the archive without header and totals
lines, either negate the <b>-h</b> and <b>-t</b> options or else specify the contents explicitly:
<p>
 <br>
<pre>zipinfo --h-t storage
zipinfo storage \*
</pre>  <p>
(where the backslash is required only if the shell would otherwise expand
the &lsquo;*&rsquo; wildcard, as in Unix when globbing is turned on--double quotes around
the asterisk would have worked as well).  To turn off the totals line by
default, use the environment variable (C shell is assumed here): <p>
 <br>
<pre>setenv ZIPINFO --t
zipinfo storage
</pre>  <p>
To get the full, short-format listing of the first example again, given
that the environment variable is set as in the previous example, it is
necessary to specify the <b>-s</b> option explicitly, since the <b>-t</b> option by itself
implies that ONLY the footer line is to be printed: <p>
 <br>
<pre>setenv ZIPINFO --t
zipinfo -t storage            [only totals line]
zipinfo -st storage           [full listing]
</pre>  <p>
The <b>-s</b> option, like <b>-m</b> and <b>-l</b>, includes headers and footers by default,
unless otherwise specified.  Since the environment variable specified no
footers and that has a higher precedence than the default behavior of <b>-s</b>,
an explicit <b>-t</b> option was necessary to produce the full listing.  Nothing
was indicated about the header, however, so the <b>-s</b> option was sufficient.
 Note that both the <b>-h</b> and <b>-t</b> options, when used by themselves or with each
other, override any default listing of member files; only the header and/or
footer are printed.  This behavior is useful when <i>zipinfo</i> is used with a
wildcard zipfile specification; the contents of all zipfiles are then summarized
with a single command. <p>
To list information on a single file within the archive,
in medium format, specify the filename explicitly: <p>
 <br>
<pre>zipinfo -m storage unshrink.c
</pre>  <p>
The specification of any member file, as in this example, will override
the default header and totals lines; only the single line of information
about the requested file will be printed.  This is intuitively what one
would expect when requesting information about a single file.  For multiple
files, it is often useful to know the total compressed and uncompressed
size; in such cases <b>-t</b> may be specified explicitly: <p>
 <br>
<pre>zipinfo -mt storage "*.[ch]" Mak\*
</pre>  <p>
To get maximal information about the ZIP archive, use the verbose option.
 It is usually wise to pipe the output into a filter such as Unix <a href='more.1'><i>more</i>(1)</a>

if the operating system allows it: <p>
 <br>
<pre>zipinfo -v storage | more
</pre>  <p>
Finally, to see the most recently modified files in the archive, use
the <b>-T</b> option in conjunction with an external sorting utility such as Unix
<a href='sort.1'><i>sort</i>(1)</a>
 (and <a href='sed.1'><i>sed</i>(1)</a>
 as well, in this example): <p>
 <br>
<pre>zipinfo -T storage | sort -nr -k 7 | sed 15q
</pre>  <p>
The <b>-nr</b> option to <a href='sort.1'><i>sort</i>(1)</a>
 tells it to sort numerically in reverse order
rather than in textual order, and the <b>-k&nbsp;7</b> option tells it to sort on the
seventh field.  This assumes the default short-listing format; if <b>-m</b> or <b>-l</b>
is used, the proper <a href='sort.1'><i>sort</i>(1)</a>
 option would be <b>-k&nbsp;8</b>. Older versions of <a href='sort.1'><i>sort</i>(1)</a>

do not support the <b>-k</b> option, but you can use the traditional <b>+</b> option instead,
e.g., <b>+6</b> instead of <b>-k&nbsp;7</b>.  The <a href='sed.1'><i>sed</i>(1)</a>
 command filters out all but the first
15 lines of the listing.  Future releases of <i>zipinfo</i> may incorporate date/time
and filename sorting as built-in options.   
<h2><a name='sect8' href='#toc8'>Tips</a></h2>
The author finds it convenient
to define an alias <i>ii</i> for <i>zipinfo</i> on systems that allow aliases (or, on
other systems, copy/rename the executable, create a link or create a command
file with the name <i>ii</i>). The <i>ii</i> usage parallels the common <i>ll</i> alias for long
listings in Unix, and the similarity between the outputs of the two commands
was intentional.   
<h2><a name='sect9' href='#toc9'>Bugs</a></h2>
As with <i>unzip</i>, <i>zipinfo</i>&rsquo;s <b>-M</b> (&lsquo;&lsquo;more&rsquo;&rsquo;) option is overly
simplistic in its handling of screen output; as noted above, it fails to
detect the wrapping of long lines and may thereby cause lines at the top
of the screen to be scrolled off before being read.  <i>zipinfo</i> should detect
and treat each occurrence of line-wrap as one additional line printed.  This
requires knowledge of the screen&rsquo;s width as well as its height.  In addition,
<i>zipinfo</i> should detect the true screen geometry on all systems. <p>
<i>zipinfo</i>&rsquo;s
listing-format behavior is unnecessarily complex and should be simplified.
 (This is not to say that it will be.) <p>
 
<h2><a name='sect10' href='#toc10'>See Also</a></h2>
<a href='ls.1'><i>ls</i>(1)</a>
, <a href='funzip.1'><i>funzip</i>(1)</a>
, <a href='unzip.1'><i>unzip</i>(1)</a>
,
<a href='unzipsfx.1'><i>unzipsfx</i>(1)</a>
, <a href='zip.1'><i>zip</i>(1)</a>
, <a href='zipcloak.1'><i>zipcloak</i>(1)</a>
, <a href='zipnote.1'><i>zipnote</i>(1)</a>
, <a href='zipsplit.1'><i>zipsplit</i>(1)</a>
   
<h2><a name='sect11' href='#toc11'>URL</a></h2>
The Info-ZIP
home page is currently at  <br>
<pre>http://www.info-zip.org/pub/infozip/
</pre>  or  <br>
<pre>ftp://ftp.info-zip.org/pub/infozip/ .
</pre>    
<h2><a name='sect12' href='#toc12'>Author</a></h2>
Greg &lsquo;&lsquo;Cave Newt&rsquo;&rsquo; Roelofs.  ZipInfo contains pattern-matching code
by Mark Adler and fixes/improvements by many others.  Please refer to the
CONTRIBS file in the UnZip source distribution for a more complete list.
<p>

<hr><p>
<a name='toc'><b>Table of Contents</b></a><p>
<ul>
<li><a name='toc0' href='#sect0'>Name</a></li>
<li><a name='toc1' href='#sect1'>Synopsis</a></li>
<li><a name='toc2' href='#sect2'>Description</a></li>
<li><a name='toc3' href='#sect3'>Arguments</a></li>
<li><a name='toc4' href='#sect4'>Options</a></li>
<li><a name='toc5' href='#sect5'>Detailed Description</a></li>
<li><a name='toc6' href='#sect6'>Environment Options</a></li>
<li><a name='toc7' href='#sect7'>Examples</a></li>
<li><a name='toc8' href='#sect8'>Tips</a></li>
<li><a name='toc9' href='#sect9'>Bugs</a></li>
<li><a name='toc10' href='#sect10'>See Also</a></li>
<li><a name='toc11' href='#sect11'>URL</a></li>
<li><a name='toc12' href='#sect12'>Author</a></li>
</ul>
</body>
</html>
